<%@ Page Language="C#" MasterPageFile="~/DoctorForum.Master" AutoEventWireup="true" Codebehind="ForumManager.aspx.cs" Inherits="WebForum.ForumManager" Title="Doctor Forum" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <h5>
        Manager Forum</h5>
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" PageSize="5" AutoGenerateColumns="False" DataKeyNames="Id" ShowFooter="True" DataSourceID="ObjectDataSource1" CellPadding="4" ForeColor="#333333" GridLines="None" Width="90%" OnRowCommand="GridView1_RowCommand"
        OnRowDeleting="GridView1_RowDeleting" OnRowUpdating="GridView1_RowUpdating">
        <Columns>
            <asp:TemplateField HeaderText="ForumName">
                <ItemTemplate>
                    <asp:Label ID="LabelId" runat="server" Text='<%# Bind("Id") %>'></asp:Label>
                </ItemTemplate>
                <FooterTemplate>
                    <asp:Button ID="Btn_Add" runat="server" ValidationGroup="Add" CommandName="Insert" Text="Insert" />
                </FooterTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Title">
                <ItemTemplate>
                    <asp:Label ID="LabelTitle" Text='<%# Eval("Title") %>' runat="server"></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBoxTitle" Text='<%# Eval("Title") %>' runat="server"></asp:TextBox>
                </EditItemTemplate>
                <FooterTemplate>
                    <asp:TextBox ID="TextBoxAddTitle" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ValidationGroup="Add" ID="RequiredFieldValidator1" Display="Dynamic" ControlToValidate="TextBoxAddTitle" runat="server" ErrorMessage="*"></asp:RequiredFieldValidator>
                </FooterTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Desc">
                <ItemTemplate>
                    <asp:Label ID="LabelDesc" Text='<%# Eval("Desc") %>' runat="server"></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBoxDesc" Text='<%# Eval("Desc") %>' runat="server"></asp:TextBox>
                </EditItemTemplate>
                <FooterTemplate>
                    <asp:TextBox ID="TextBoxAddDesc" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ValidationGroup="Add" ID="RequiredFieldValidator2" Display="Dynamic" ControlToValidate="TextBoxAddDesc" runat="server" ErrorMessage="*"></asp:RequiredFieldValidator>
                </FooterTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Position">
                <ItemTemplate>
                    <asp:Label ID="LabelPosition" Text='<%# Eval("Position") %>' runat="server" Width="30"></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBoxPosition" Text='<%# Eval("Position") %>' runat="server" Width="30"></asp:TextBox>
                </EditItemTemplate>
                <FooterTemplate>
                    <asp:TextBox ID="TextBoxAddPosition" runat="server" Text="0" Width="30"></asp:TextBox>
                    <asp:RequiredFieldValidator ValidationGroup="Add" ID="RequiredFieldValidator3" Display="Dynamic" ControlToValidate="TextBoxAddPosition" runat="server" ErrorMessage="*"></asp:RequiredFieldValidator>
                </FooterTemplate>
            </asp:TemplateField>
            <asp:CommandField HeaderText="Edit" ShowEditButton="True" ButtonType="Button" />
            <asp:TemplateField HeaderText="Delete">
                <ItemTemplate>
                    <asp:Button ID="ButtonDelete" runat="server" CommandName="Delete" Text="Delete" OnClientClick="return confirm('Are you sure you want to delete this user?');" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="SubForum">
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLinkSubForum" runat="server" NavigateUrl='<%#"SubForumManager.aspx?id="+Eval("Id")%>'>SubForum</asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
    <asp:ObjectDataSource ID="ObjectDataSource1" TypeName="WebForum.App_Data.ForumDataSource" UpdateMethod="UpdateNull" DeleteMethod="Delete" SelectMethod="List" runat="server" InsertMethod="Insert"></asp:ObjectDataSource>
</asp:Content>
